﻿using System;
using System.Reflection;
using JetBrains.Annotations;

namespace MugenInjection.Logging.Interface
{
    /// <summary>
    /// Represents the logger context.
    /// </summary>
    public interface ILoggerContext
    {
        /// <summary>
        /// Gets the <see cref="ILogger"/> created context.
        /// </summary>
        
        ILogger Logger { get; }

        /// <summary>
        /// Gets the method of calling log.
        /// </summary>
        
        MethodBase CallingMethod { get; }

        /// <summary>
        /// Gets the level of the log.
        /// </summary>
        LogLevel LogLevel { get; }

        /// <summary>
        /// Gets the message of the log.
        /// </summary>
        
        string LogMessage { get; set; }

        /// <summary>
        /// Gets the arguments of the log. (Can be null).
        /// </summary>
        
        object[] Args { get; set; }

        /// <summary>
        /// Gets the exception of the log. (Can be null).
        /// </summary>
        
        Exception Exception { get; }
    }

    /// <summary>
    /// The level of the log.
    /// </summary>
    [Flags]
    public enum LogLevel
    {
        /// <summary>
        /// DEBUG level.
        /// </summary>
        Debug = 0x0,
        /// <summary>
        /// INFO level.
        /// </summary>
        Info = 0x1,
        /// <summary>
        /// TRACE level.
        /// </summary>
        Trace = 0x2,
        /// <summary>
        /// WARN level.
        /// </summary>
        Warn = 0x4,
        /// <summary>
        /// ERROR level.
        /// </summary>
        Error = 0x8,
        /// <summary>
        /// FATAL level.
        /// </summary>
        Fatal = 0x10
    }
}